import Vue from 'vue'
import VueI18n from 'vue-i18n'
import elementZH from 'element-ui/lib/locale/lang/zh-CN'
import elementEN from 'element-ui/lib/locale/lang/en'
// a.引入en
import menuZH from './zh'
// b.引入zh
import menuEH from './en'
Vue.use(VueI18n)
export default new VueI18n({
  locale: localStorage.getItem('lang') || 'zh',
  messages: {
    zh: {
      morning: '早上好!',
      niceday: '祝你开心每一天',
      ...elementZH,
      //   c.将数据存入VueI18n
      ...menuZH
    },
    en: {
      morning: 'Good Morning!',
      niceday: 'have a good day!',
      ...elementEN,
      ...menuEH
    }
  }
})
